package com.chenpeijian.demo.demos.web.controller;

import com.chenpeijian.demo.service.WeatherApi;
import com.chenpeijian.demo.service.dto.Add4DTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

/**
 * @program: student_code
 * @description:
 * @author: 陈培建
 * @create: 2025-01-17 13:55
 **/
@RestController
public class UserController {
    @Autowired
    private WeatherApi weatherApi;
    @GetMapping("/getUser")
    ResponseEntity<String> getUser(@RequestParam("name") String name){
        System.out.println("getUser");
        return ResponseEntity.ok(name);
    }
    @PostMapping("/addUser")
    ResponseEntity<Add4DTO> addUser(@RequestBody Add4DTO user){
        return ResponseEntity.ok(user);
    }
    @GetMapping("/getUserTest")
    ResponseEntity<String> getUser(){
        String resut = weatherApi.getUser("fdsfds", 1);
        return ResponseEntity.ok(resut);
    }
}
